﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
//using System.Windows.Shapes;
using System.IO;
using Microsoft.Win32;
using CAD;

namespace HoloXiaGestion
{
    /// <summary>
    /// Logique d'interaction pour MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        string path;
        Cad.CAD proc = new Cad.CAD();

        public MainWindow()
        {
            InitializeComponent();
        }

        private void button_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openfile = new OpenFileDialog();
            openfile.Multiselect = true;
            //openfile.Filter = "";
            openfile.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            if (openfile.ShowDialog() == true)
            {
                lblImgNom.Content = openfile.FileName;
                path = openfile.FileName;
            }
        }

        private void btnValiderImg_Click(object sender, RoutedEventArgs e)
        {
            proc.DonneeAppli(path, txtBNom.Text, txtBtxt.Text);
        }

        private void btnValiderTxt_Click(object sender, RoutedEventArgs e)
        {
            string texte;
            texte = txtBtxt.Text;
            proc.DonneeAppli(path, txtBNom.Text, txtBtxt.Text);
        }
    }
}
